import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes: [
    {
      path: "/home",
      name: "Home",
      component: Home,
    },
    {
      path: "/live",
      name: "Live",
      component: () =>
        import(/* webpackChunkName: "live" */ "../views/Live.vue"),
      children: [
        {
          path: "livedetail/:id",
          name: "Livedetail",
          component: () =>
            import(
              /* webpackChunkName: "livedetail" */ "../components/Livedetail.vue"
            ),
        },
      ],
    },
    {
      path: "/",
      redirect: "/home",
    },
  ],
});

export default router;
